<template>
    <div>

        <el-card class="box-card minHeight400px">
            <div slot="header" class="clearfix rowSpaceBetweenAlignCenter">
                <div class="noselect cursorPointer" @click="$router.go(-1)">
                    <i class="el-icon-back"></i>
                    <span>{{ title === null ? '笔记': title }}</span>
                </div>
            </div>
            
            <div class="paddingTop20">
                {{ content }}
            </div>


        </el-card>

       

        
    </div>
</template>



<script>
import { mapState, mapMutations, mapGetters, mapActions } from 'vuex'
import { watch } from 'vue'
import { apiDetailNotes } from '@/api/admin'
export default {
    data() {
        return {
            id: null,
            title: null,
            content: ''
        }
    },
    
    methods: {
        judgeAction () {
            if (!this.$route.query.id) {
                return this.fn.alertAndBack('缺少ID')
            }

            apiDetailNotes({id: this.$route.query.id}).then(res => {
                this.fn.clogJsons(res)
                this.id = res.data.id
                this.title = res.data.title
                this.content = res.data.content
            }).catch(e => {
                this.fn.eWarning(JSON.stringify(e))
            })
        }

    },
    mounted() {
        this.judgeAction()
    }
}
</script>